package cn.wolfcode.mapper;

import cn.wolfcode.domain.Permission;
import cn.wolfcode.domain.Role;
import cn.wolfcode.domain.Student;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    List<Role> selForList(QueryObject qo);

    //中间表添加
    void insertToMiddleTable(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    //中间表删除
    void deleteToMiddleTable(Long roleId);

    void insertRelationBatch(@Param("roleId") Long roleId, @Param("permissionIds") Long[] permissionIds);

    List<Role> selEmployeeRoleById(Long id);

    List<Role> selRolesByStudentId(Long id);
}
